/**
 * std.js - Standard library of commonly used functions 
 *
 */

/**
 * Include other javascript files from within a javascript
 *
 */
function include(path) {
  var head = document.getElementsByTagName('head')[0];
  script = document.createElement('script');
  script.src = path;
  script.type = 'text/javascript';
  head.appendChild(script);
};

/**
 * Inherit from a super class properly
 *
 */
Object.prototype.Inherits = function( parent ) {
  if( arguments.length > 1 )
    parent.apply( this, Array.prototype.slice.call( arguments, 1 ) );
  else
    parent.call( this );
};

Function.prototype.Inherits = function( parent ) {
  this.prototype = new parent();
  this.prototype.constructor = this;
};

// Array Remove - By John Resig (MIT Licensed)
Array.prototype.remove = function(from, to) {
  var rest = this.slice((to || from) + 1 || this.length);
  this.length = from < 0 ? this.length + from : from;
  return this.push.apply(this, rest);
};